LockForums
}} LockForums disables the replying field on threads that haven't been commented on in the past 30 days, effectively allowing them to be automatically archived over time. There are many configuration options, including the ability to set a warning period prior to locking, displaying a banner at the top of the page, and more. See Configuration for more details. Note: For backwards-compatibility, message walls and message wall threads are left unlocked by default. You can change this by enabling the the lockMessageWalls flag. Installation Configuration There are some custom configuration options that you can use if you want to: These configuration options should be added to MediaWiki:Common.js, and the syntax for using these options goes like this: window.LockForums = { lockMessageWalls: boolean, expiryDays: number, expiryMessage: string, warningDays: number, warningMessage: string, disableOn: array, banners: boolean, expiryBannerMessage: string, expiryBannerStyle: object (or "stylesheet"), warningBannerMessage: string, warningBannerStyle: object (or "stylesheet"), warningPopup: boolean, warningPopupMessage: string }; Note that you only need to define the fields you wish to change from the defaults, and they may be defined in any order. Example 1 Let's say you want to do the following: * Old threads should be locked from replying after 60 days * The message should say This thread is considered archived because it hasn't been commented on in over 60 days, please don't bump this thread! Here's the code you would put in your MediaWiki:Common.js with those configuration options: window.LockForums = { expiryDays: 60, expiryMessage: "This thread is considered archived because it hasn\'t been commented on in over days, please don\'t bump this thread!" }; Example 2 Let's say you want to do the following: * Old threads should be locked from replying after 180 days * However, after 30 days, you want to warn people that they shouldn't be replying unless absolutely necessary. * The expiry message should say This thread has been automatically archived because its most recent comment is over 180 days old. * The warning message should say This thread is now days old; out of courtesy to your fellow Wikians, please do not comment unless it is absolutely necessary. This thread will archive automatically when the last comment is 180 days old. * A banner at the top of the page should clearly mark the expired and warned threads. The default text is fine. * You would like a confirmation dialog to pop up for people posting on threads older than 30 days. * This popup message should read By posting on an old thread you may be filling up the e-mail boxes of many people who are still following this thread. Are you sure you want to do this? * Disable on Thread:12345 and Thread:67890 Here's the code you would put in your MediaWiki:Common.js with those configuration options: window.LockForums = { expiryDays: 180, expiryMessage: "This thread has been automatically archived because its most recent comment is over days old.", warningDays: 30, warningMessage: "This thread is now days old; out of courtesy to your fellow Wikians, please do not comment unless it is absolutely necessary. This thread will archive automatically when the last comment is days old.", banners: true, warningPopup: true, warningPopupMessage: "By posting on an old thread you may be filling up the e-mail boxes of many people who are still following this thread. Are you sure you want to do this?", disableOn: "67890" }; If the banner is used it will look like this (as a default): Note: This thread has been unedited for 143 days. It is considered archived - the discussion is over. If you feel this thread needs additional information, contact an administrator. Notes * Inside of the expiryMessage, warningMessage, expiryBannerMessage, warningBannerMessage and warningPopupMessage strings, The apostrophe character ' must be replaced with \' and the quote character " must be replaced with \". This is called an "escape character" in JavaScript. * Inside of these strings, you can (if you want to) use the tag which will automatically be replaced with the expiryDays variable, which is 60 in this example. You may also use for the warningDays variable, and actualDays for the actual time elapsed since the most recent post.